import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export const store = new Vuex.Store({
	//状态
	state:{
		login:false
	},
	//获取状态
	getters:{
		login: state=>{
			return state.login
		}
	},
	//修改状态
	mutations:{
		checkLogin:(state,payload)=>{
			state.login = payload
		}
	},
	//异步分发
	actions:{
		checkLogin:({commit},payload)=>{
			commit('checkLogin',payload)
		}
	}
})


